<template>
	<view  class="content" :data-theme="vtheme">
		<view class="text-area">
			<text class="title">{{title}}</text>
		</view>
		<image class="logo" :src="`/static/${vtheme}/1.png`"></image>
		<view class="bg-test" :data-theme="vtheme"></view>

		<view class="theme">
		<button type="default" class="button" @click="changeTheme('day-theme')">day</button>
		<button type="default" class="button" @click="changeTheme('night-theme')">night</button>
	</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				title: '使用data-theme实现主题切换',
			};
		},

		methods: {
			changeTheme(theme){
				this.vGetTheme(theme);
			},
		}
	}
</script>

<style lang="scss" scoped>
	.content {
		height: 100%;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}
	.theme{
		width: 100%;
		display: flex;
		justify-content: center;
		padding: 0 20%;
		.button{
			width: 100px;
		}
	}
	.bg-test {
		width: 300px;
		height: 160px;
		border-radius: 10px;
		border: 1px solid;
	}

	.logo{
		width: 100px;
		height: 100px;
	}

</style>
